﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Serialization;


namespace DiskGarden
{
	public class Locale
	{
		static private Locale locale = null;
		static internal Locale I { get { return GetInstance(); } }
		static public Locale GetInstance()
		{
			if (locale == null)
				try
				{
					FileStream fsInput = new FileStream(Options.LanguageFile, FileMode.Open);
					XmlSerializer xml = new XmlSerializer(typeof(Locale));
					locale = (Locale)xml.Deserialize(fsInput);
					fsInput.Close();
				}
				catch (Exception)
				{
					if (locale == null)
						locale = new Locale();
				}
			return locale;
		}

		static public void SaveToFile()
		{
			FileStream fsOutput = new FileStream("english.lng", FileMode.Create);
			XmlSerializer xml = new XmlSerializer(typeof(Locale));
			xml.Serialize(fsOutput, GetInstance());
			fsOutput.Close();
		}

		private Locale() { }

		public string File = "File";
		public string New = "New";
		public string Open = "Open";
		public string Save = "Save";
		public string SaveAs = "Save As";
		public string Exit = "Exit";
		public string ImportXML = "Import from XML";
		public string ExportXML = "Export to XML";

		public string Edit = "Edit";
		public string AddCategory = "Add category";
		public string AddDisk = "Add disk";
		public string Delete = "Delete";
		public string Properties = "Properties";
		public string Find = "Find";
		public string Refresh = "Refresh";

		public string Name = "Name";
		public string Size = "Size";
		public string Path = "Path";
		public string Modified = "Modified";
		public string Atributes = "Atributes";
		public string Comment = "Comment";

		public string SelectDrive = "Select drive";
		public string SelectFolder = "Select folder";

		public string OK = "OK";
		public string Cancel = "Cancel";

		public string FindWhat = "Find what:";
		public string Disk = "Disk";

		public string PleaseWait = "Please wait";
		public string PleaseWaitCataloguing = "Please wait, cataloguing...";

		public string DoYouWantDeleteFile = "Do you want remove file: {0} ?";
		public string DeleteQuestion = "Delete?";
		public string DoYouWantExit = "Do you want exit?";
		public string ExitQuestion = "Exit?";
		public string FolderDoesntExist = "Folder doesn't exist";
		public string YouDontChooseDrive = "You don't choose drive";

		public string Bytes = "bytes";
		public string Tags = "Tags";
		public string Stop = "Stop";
	}
}
